package com.socket.socketObjTest;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * LoginServer--bdqnPractice
 *
 * @author: Jovi
 * @createTime: 2017-09-06 16:14
 **/
public class LoginServer {

    public static void main(String[] args) {
        try {
            ServerSocket ss = new ServerSocket(8800);
            Socket socket = ss.accept();
            InputStream is = socket.getInputStream();

            ObjectInputStream ois = new ObjectInputStream(is);

            try {
                User user = (User)ois.readObject();
                System.out.println("用户信息："+user);
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }


            ois.close();
            is.close();
            ss.close();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
